import Vue from 'vue'
import Vuex from 'vuex'
import Axios from 'admin/config/axios'

Vue.use(Vuex);

const state = {
	permission : {}
}

const mutations = {
	PER(state,data){
        state.permission = data;
	}
}

const actions = {
	SETPER({ commit}){
        Axios.Config.Permission.User()
        .then(res=>{
            if(!res) return false;
            var data = res.data;
            commit('PER',data);
        })
	},
}

const getters= {
    per:function(state){
        return state.permission;
    }
}

const store = new Vuex.Store({
  	state : state,
  	mutations : mutations,
  	actions : actions,
  	getters : getters,
})
export default store;